package com.an.blog.web.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.an.blog.service.IBlogCategoryService;
import com.an.blog.web.domain.vo.BlogArticleWebVo;
import com.an.blog.web.domain.vo.BlogCategoryWebVo;
import com.an.common.core.domain.R;
import com.an.common.core.page.TableDataInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 博客类别web控制器
 *
 * @author: Ann
 * @createDate: 2023/05/27 10:21:09
 * @version: 1.0.0
 */
@RestController
@RequestMapping("/blog-web/category")
@RequiredArgsConstructor
public class BlogCategoryWebController {

    private final IBlogCategoryService categoryService;
    /**
     * 查询文章列表
     *
     * @return {@link TableDataInfo }<{@link BlogArticleWebVo }>
     * @author: Ann
     * @createDate: 2023/05/26 16:32:49
     * @version: 1.0.0
     */
    @SaIgnore
    @GetMapping("/list")
    public R<List<BlogCategoryWebVo>> queryCategoryWebList() {
        return R.ok(categoryService.queryCategoryWebList());
    }
}
